import 'reflect-metadata'

function genRequestDecorator(type: string) {
  return function (path: string) {
    return function (target: any, key: string) {
      // console.log(target, '方法装饰器的第一个参数0') //类的原型对象
      // let target1 = Object.getOwnPropertyNames(target)
      //console.log(target1, '方法装饰的第一个参数1111')
      Reflect.defineMetadata('path', path, target, key)
      Reflect.defineMetadata('method', type, target, key)
      //console.log(type)
    }
  }
}

export const get = genRequestDecorator('get')
export const post = genRequestDecorator('post')
export const del = genRequestDecorator('delete')
export const put = genRequestDecorator('put')
export const patch = genRequestDecorator('patch')
